const state = {
  show: true,
  changeNum: 0
}

const getters = {
  isShow (state) {
    return state.show
  },
  getNum (state) {
    return state.changeNum
  }
}

const mutations = {
  show (state) {
    state.show = true
  },

  hide (state) {
    state.show = false
  },

  newNum (state, num) {
    state.changeNum += num
  }
}

const actions = {
  hideContent (context) {
    context.commit('hide')
  },

  showContent (context) {
    context.commit('show')
  },

  getNewnum (context, num) {
    context.commit('newNum', num)
  }
}

export default {
  namespaces: true,
  state,
  getters,
  mutations,
  actions
}
